<?php
namespace app\validate;
use share\validate\SceneValidate;

class AdminPathinfoValidate extends SceneValidate{
    protected $rule = [
        'id' => 'require|integer',
        'roles' => 'require|array',
        'pathInfo' => 'length:2,200',
        'method' => 'require|length:2,6',
        'show' => 'require|length:2,100',
        'message' => 'length:1,200',
        'icon' => 'length:2,60000',
        'iconType' => 'length:2,60',
        'pid' => 'require|integer',
        'pathType' => 'require|integer',
        'checkLogin' => 'require|integer',
        'checkAuth' => 'require|integer',
    ];    

    protected $sceneRules = [
        'edit' =>[
            'id' => 'require|integer|>=:1',
            'pathInfo' => 'length:2,200',
            'method' => 'length:2,6',
            'show' => 'length:2,100',
            'message' => 'length:1,200',
            'icon' => 'length:2,60000',
            'iconType' => 'length:2,60',
            'pid' => 'integer',
            'pathType' => 'integer',
            'checkLogin' => 'integer',
            'checkAuth' => 'integer',
        ],
        'getAllPath' => [
            'pathType' => 'integer',
        ],
    ];


    protected $scene = [
        'get' => ['id'],
        'set' => ['id','roles'],
        'add' => ['pathInfo','method','show','message','icon','iconType','pid','pathType','checkLogin','checkAuth'],
        'edit' => ['id','pathInfo','method','show','message','icon','iconType','pid','pathType','checkLogin','checkAuth'],
        'del' => ['id'],
        'getAllPath' => ['pathType'],

    ];
}
